String.prototype.trim = function() {
	return this.replace(/(^\s*)|(\s*$)/g, "");
}
//验证提交
function checkSubmit(path)
{
  var  password = $("#password");
  if(password.val().trim().length==0)
  {
     alert("请输入密码!");
     password.focus();
     return;
  }
  var  newpass = $("#newpass");
  if(newpass.val().trim().length==0)
  {
     alert("请再次输入密码!");
     newpass.focus();
     return;
  }
  if(!(password.val().trim()==newpass.val().trim()))
  {
     alert("输入的密码，两次密码不一致!");
     newpass.focus();
     return;
  }
  var  code = $("#code");
  if(code.val().trim().length==0)
  {
     alert("请输入验证码!");
     code.focus();
     return;
  }
  $.ajax({
     type:'post',
     url:'../../member/checkCode.action?code='+code.val(),
     success:function(msg)
     {
         var a=eval('('+msg+')');
         if(!a['result'])
         {
            alert('验证码输入错误!')
         }else{
              
		        $.ajax({
		         data:'tsSysuser.id='+$("#loginId").val().trim()+"&tsSysuser.password="+password.val().trim(),
		        url:'../../member/modifyWebPass.action',
		        type:'post',
		        success:function(msg){
		             if(msg)
		             {
		                alert('密码修改成功!');
		                window.location.href="../../user/memberInfo.action";
		                // window.location.href=path+"user/memberInfo.action"
		             }else{
		                alert('密码修改失败!');
		             }
		           
		          }});
            
         }
        
     }
  
  });
         

 
}
function  resetForm()
{
  var  password = $("#password");
  password.val('');
  var  newpass = $("#newpass");
  newpass.val('');
   var  code = $("#code");
   code.val('');

}
  function  loadCode()
{
   var  img =$("#img");
   img.attr("src","../register/yanzhengma.jsp?date="+new Date());
}
